<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户充值</title>
    <link href="${pageContext.request.contextPath}/static/css/recharge.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/static/js/recharge.js"></script>
</head>
<body>
    <div class="container">
        <h2 class="title">用户充值</h2>
        <!-- 添加 novalidate 属性 -->
        <form action="${pageContext.request.contextPath}/recharge" method="post" onsubmit="return validateAmount();" novalidate>
            <input type="hidden" name="id" value="${user.id}">
            <div class="form-group">
                <label for="amount">充值金额(0 - 1000):</label>
                <input type="number" id="amount" name="amount" step="10" min="0" max="1000">
            </div> 
            <input type="submit" value="充值" class="btn btn-recharge">
        </form>
        <!-- 添加退出按钮 -->
        <button onclick="window.location.href='${pageContext.request.contextPath}/userPage'" class="btn btn-cancel">退出</button>
    </div>
</body>
</html>